package com.wx.wxpush.mapper;

import com.wx.wxpush.entiy.TempData;
import com.wx.wxpush.entiy.TemplateData;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

@Component
public interface PusherMapper {

    @Insert("insert into sys_openid (openid,appid,secret,morning_template_id,eve_template_id,riqi,tianqi,low,high,caihongpi,lianai,lianaitime,shengri,jinju,beizhu,district,birthday,remark,ipAddress) values (#{openid},#{appid},#{secret},#{morningTemplateId},'eJ_fNm-R8p1ZtvBssCshJO5-COJjrai2YYY_EGCE1p0',#{riqi},#{tianqi},#{low},#{high},#{caihongpi},#{lianai},#{lianaitime},#{shengri},#{jinju},#{beizhu},#{district},#{birthday},#{remark},#{ipAddress})")
    void pushmorning( TempData templateData);

    @Select("select openid from sys_openid where openid=#{openid}")
    String selectByOpenid(String openid);


    @Update("update sys_openid set lianaitime=#{lianaitime},birthday=#{birthday}, district=#{district},morning_template_id=#{morningTemplateId},ipAddress=#{ipAddress},remark=#{remark} where openid=#{openid}")
    void updateByOpenid(TempData templateData);



}
